#!/usr/bin/python
# -*- coding: UTF-8 -*-
# author: WuJian 2022-10-12
# desc: 主测试类定义

import unittest
from unittestreport import TestRunner

class MainUnitTestApp:
    def __init__(self):
        self.html_enable = True
        pass

    def start(self):
        suite = unittest.defaultTestLoader.discover(start_dir=".", pattern='test*.py')

        if self.html_enable:
            runner = TestRunner(suite=suite, filename='at_test_report.html', report_dir='./', title='AT命令测试报告', tester='吴建', 
                desc="AT命令测试报告", templates=1)
            runner.run()
        else:
            runner = unittest.TextTestRunner(verbosity=2)
            runner.run(suite)

if __name__ == "__main__":
    MainUnitTestApp().start()
